<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateOpenShopSiteLocationProductAnalysisTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('open_shop_site_location_product_analysis', function (Blueprint $table) {
            $table->id();
            $table->string('orderNo')->default('')->comment('订单编号');
            $table->unsignedBigInteger('siteId')->default(0)->comment('主表id');
            $table->unsignedTinyInteger('type')->default(1)->comment('1:竞品 2 互补品');
            $table->string('productName', 64)->default('')->comment('名称');
            $table->unsignedInteger('hallFoodNumber')->default(0)->comment('堂食客单量');
            $table->unsignedInteger('hallFoodUnitPrice')->default(0)->comment('堂食客单价');
            $table->unsignedInteger('elemNumber')->default(0)->comment('堂食客单量');
            $table->unsignedInteger('elemUnitPrice')->default(0)->comment('堂食客单价');
            $table->unsignedInteger('meituanNumber')->default(0)->comment('堂食客单量');
            $table->unsignedInteger('meituanUnitPrice')->default(0)->comment('堂食客单价');
            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('createdByUid')->default(0)->comment('创建人');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->unsignedInteger('updatedByUid')->default(0)->comment('修改人');
            $table->collation = 'utf8mb4_general_ci';
            $table->comment   = '选址表单-菜品分析表';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('open_shop_site_location_product_analysis');
    }
}
